package com.funever.myyouku;

import util.Utils;

import com.funever.fragment.MainPageFragment;
import com.funever.fragment.MenuFragment;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;

public class MainActivity extends SlidingFragmentActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.content_frame);
		setBehindContentView(R.layout.menu_frame);
		
		getSlidingMenu().setSlidingEnabled(true);
		getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
		
		SlidingMenu sm = getSlidingMenu();
		sm.setBehindOffset(Utils.dip2px(this, 200));
		sm.setShadowWidth(25);
		sm.setBehindScrollScale(0.05f);
		sm.setFadeDegree(0.5f);
		
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		ft.replace(R.id.content_frame, new MainPageFragment());
		ft.replace(R.id.menu_frame, new MenuFragment());
		ft.commit();
	}

}
